package cn.edu.jxau.admin.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.jxau.domain.notice;
import cn.edu.jxau.service.readMessage;

public class readNoticeServlet extends HttpServlet {

	/**
	 * 后台页面读取已经发布的公告
	 */
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        
		request.setCharacterEncoding("utf-8");
	 	response.setContentType("text/html;charset=utf-8");
	    
	 	List<notice> list=readMessage.readNotice();
	 	
	 	request.getSession().setAttribute("notice", list);
	 	
	 	response.sendRedirect("admin/noticeManage.jsp");
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(req, resp);
	}
	
}
